package com.topsun.framework;

import cn.hutool.core.io.FileTypeUtil;
import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.topsun.framework.common.core.util.FileUtil;
import com.topsun.framework.common.mybatis.plugins.page.Pagination;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.io.File;
import java.util.List;

@SpringBootApplication
public class Main {
    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(Main.class, args);
//        KafkaMessageSender sender = applicationContext.getBean(KafkaMessageSender.class);
//        sender.sendToDefaultChannel(new KafkaStreamListener.User("123", 16));
//        Pagination<BusInfo> pagination = com.topsun.framework.common.mybatis.plugins.page.Page.query(1, 2, () -> {
//            return applicationContext.getBean(BusInfoMapper.class).selectList(null);
//        });
////        Page<BusInfo> busInfoPage = applicationContext.getBean(BusInfoMapper.class).selectPage(new Page<>(1, 2), null);
//        System.out.println(pagination);

        TNameService tNameService = applicationContext.getBean(TNameService.class);
        List<TName> tNames = tNameService.list();
        System.out.println(JSON.toJSONString(tNames));
//
//        tNameService.saveBatchSomeColumn(tNames);
    }
}